package com.zjp.common.enums;

import cn.hutool.core.util.StrUtil;

public enum OrderStatusEnum {
    // 1 预订单 2 已支付 3 超时 4 取消


    one("预订单", 1),
    two("已支付", 2),
    three("超时", 3),
    four("取消", 4),
    ;


    OrderStatusEnum(String name, Integer status) {
        this.name = name;
        this.status = status;
    }

    private final String name;
    private final Integer status;


    public String getName() {
        return name;
    }

    public Integer getStatus() {
        return status;
    }

    public static String selectName(Integer status) {
        for (OrderStatusEnum value : values()) {
            if (value.getStatus().equals(status)) {
                return value.getName();
            }
        }
        return StrUtil.EMPTY;
    }   public static OrderStatusEnum selectEnum(Integer status) {
        for (OrderStatusEnum value : values()) {
            if (value.getStatus().equals(status)) {
                return value;
            }
        }
        return null;
    }


}
